package com.itcast.utils;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 * @Author: Ray
 * @Date: 2020/12/09 23:06
 */


public class JpaUtils {

    private static EntityManagerFactory factory;

static{
        factory = Persistence.createEntityManagerFactory("myJpa");
        }

public static EntityManager getEntityManager(){
        return factory.createEntityManager();
        }
        }
